<script setup lang="ts">
import {getTimeMessage} from "@/utils/getTimeMessage.ts";
import {useUserStore} from "@/store/user.ts";
import Avatar from "@/components/Avatar.vue";

const userStore = useUserStore()
const {name, avatarSvg} = userStore.adminInfo
</script>

<template>
  <div class="home">
    <el-card>
      <div class="card-user-info">
        <Avatar :avatarSvg="avatarSvg" :scale="1.6" :size="80"/>
        <h2>{{ getTimeMessage() }}好 <span>{{ name }}</span></h2>
      </div>
      <div class="card-bg">
        <img src="http://img.hangdan.top/cgym/admin/home-bg.png">
      </div>
    </el-card>
  </div>
</template>

<style scoped lang="scss">
.home {

  .el-card {
    height: calc(90vh - 40px);
    box-sizing: border-box;

    .card-user-info {
      display: flex;
      width: 100%;
      height: 100px;
      padding: 0 30px;
      align-items: center;

      img {
        width: 80px;
        height: 80px;
        border-radius: 40px;
      }

      h2 {
        margin-left: 20px;

        span {
          color: #8b51fd;
        }
      }
    }

    .card-bg {
      display: flex;
      height: calc(90vh - 140px);
      justify-content: center;
      align-items: center;

      img {
        width: 500px;
      }
    }
  }
}
</style>